package com.iflytek.yly.jetpackdemo.lifecycle;

import androidx.lifecycle.LifecycleService;

public class MyService extends LifecycleService {

    private MyServiceObserver myServiceObserver;

    public MyService(){
        myServiceObserver = new MyServiceObserver();
        // 将观察者与被观察者绑定
        getLifecycle().addObserver(myServiceObserver);
    }
}
